package com.wz.jiangsu.controller.front;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDate;
import java.util.List;

/**
 * @program: wz
 * @author: wangzhou
 * @create: 2024-01-05 17:08
 * @description:
 **/
@RestController
@RequestMapping("/front")
public class TestController {


    @PostMapping("/test")
    public User test(User user, MultipartFile avatar) {
        System.out.println("avatar = " + avatar.getSize());
        System.out.println(user);
        return user;
    }
    @Data
    static class User {
        private String username;

        private String password;

        private String hidden;

        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private LocalDate birthday;

        private String sex ;

        private List<String> fav;
    }

}
